import axios from 'axios'
import request from './request'

// get方法里面第二个参数是一个对象，里面有一个params的属性，专门是放请求的参数,没有参数就不需要写
// export const commonApi = (params) => request.get("menus", { params: params })
// 登录api
export const loginApi = (params) => request.post("login", params)
// 获取侧边栏api
export const menusApi = (params) => request.get("menus")
//获取用户列表
export const usersApi = (params) => request.get("users", { params: params })
//提交用户列表的状态更改
export const userStateApi = (ids, types) => request.put("users/" + ids + "/state/" + types + "")
// 提交添加用户的表单
export const adduserSubmitApi = (params) => request.post('users', params)
//查询用户信息
export const inquireuserApi = (ids, params) => request.get("users/" + ids + "", params)
//修改用户信息
export const edituserApi = (ids, params) => request.put("users/" + ids + "", params)
//删除单独用户信息
export const removeuserApi = (id) => request.delete("users/" + id + "")
// 获取用户权限列表
export const rightsUserListApi = (type) => request.get("rights/"+ type +"")
//获取用户角色列表
export const roleUserListApi = () => request.get("roles")
//删除角色指定权限
export const deletRoleRightsApi = (roleId,rightId) => request.delete("roles/" + roleId + "/rights/" + rightId +"")
// 角色授权
export const roleRightsApi = (roleId, ridsStr) => request.post("roles/" + roleId +"/rights",{rids:ridsStr})
// 商品分类
export const goodsCateApi = (params) => request.get("categories", { params: params})
//获取父级分类列表
export const getParentCateApi = () => request.get("categories?type=2")
// 添加分类提交
export const addCateApi = (params) => request.post("categories", params)











